home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / memsz313.zip / ESPANOL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-01-17  |  3KB  |  149 lines

  1. /* ESPANOL.CMD: Instalación de MEMSIZE en español */
  2.  
  3. '@Echo Off'
  4. 'CHCP 850'
  5.  
  6. /* Cargar REXXUTIL */
  7.  
  8. Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  9. Call SysLoadFuncs
  10.  
  11.  
  12. /* Initialize */
  13.  
  14. Signal On Failure Name FAILURE
  15. Signal On Halt Name HALT
  16. Signal On Syntax Name SYNTAX
  17.  
  18. Call SysCls
  19. Say 'Instalación de MEMSIZE...'
  20. Say ''
  21.  
  22.  
  23. /* Verify the existence of the various component files. */
  24.  
  25. Language = 'ESPANOL'
  26.  
  27. Result = SysFileTree( 'MEMSIZE.EXE', 'Files', 'F' )
  28. If Files.0 = 0 Then
  29.   Do
  30.   Say 'ERROR: ¡No se encuentra el MEMSIZE.EXE!'
  31.   Signal DONE
  32.   End
  33.  
  34. Result = SysFileTree( Language".DLL", 'Files', 'F' )
  35. If Files.0 = 0 Then
  36.   Do
  37.   Say 'ERROR: ¡No se encuentra el 'Language'.DLL!'
  38.   Signal DONE
  39.   End
  40.  
  41. Result = SysFileTree( Language".HLP", 'Files', 'F' )
  42. If Files.0 = 0 Then
  43.   Do
  44.   Say 'ERROR: ¡No se encuentra el 'Language'.HLP!'
  45.   Signal DONE
  46.   End
  47.  
  48. /* Ask for the target directory name. */
  49.  
  50. Say 'Por favor, escriba el nombre completo del directorio en el'
  51. Say '  que quiere instalar el programa MEMSIZE (por defecto es C:\OS2\APPS): '
  52. Parse Pull Directory
  53. If Directory = "" Then Directory = 'C:\OS2\APPS'
  54.  
  55.  
  56. /* Create the target directory if necessary. */
  57.  
  58. Result = SysFileTree( Directory, 'Dirs', 'D' )
  59. If Dirs.0 = 0 Then
  60.   Do
  61.   Result = SysMkDir( Directory )
  62.   if Result == 0 Then
  63.     Do
  64.     End
  65.   Else
  66.     Do
  67.     Say 'ERROR: No se puede crear el directorio destino.'
  68.     Signal DONE
  69.     End
  70.   End
  71. Say ''
  72.  
  73.  
  74. /* Ask for the target folder. */
  75.  
  76. Say "¿Quiere instalarlo de forma que se ejecute automáticamente al arrancar? (S/N)"
  77. Pull YesNo
  78. If YesNo = "S" Then
  79.   Do
  80.   Folder = '<WP_START>'
  81.   Say "El objeto se copiará en la carpeta Inicio."
  82.   End
  83. Else
  84.   Do
  85.   Folder = '<WP_DESKTOP>'
  86.   Say "El objeto se copiará en el Escritorio."
  87.   End
  88. Say ''
  89.  
  90.  
  91. /* Destroy the old object, if present. */
  92.  
  93. Call SysDestroyObject( '<MEMSIZE>' )
  94. Call SysSleep( 5 )
  95.  
  96.  
  97. /* Perform the installation. */
  98.  
  99. Say 'Copiando MEMSIZE al directorio ' Directory '...'
  100. Copy MEMSIZE.EXE Directory                  '1>NUL'
  101. Copy Language".DLL" Directory"\MEMSIZE.DLL" '1>NUL'
  102. Copy Language".HLP" Directory"\MEMSIZE.HLP" '1>NUL'
  103. Copy Language".DOC" Directory"\MEMSIZE.DOC" "1>NUL"
  104.  
  105. Result = SysFileTree( "HLP2INF.EXE", 'Files', 'F' )
  106. If Files.0 > 0 Then
  107.    Do
  108.    Result = SysFileTree( Directory"\MEMSIZE.INF", 'Files', 'F' )
  109.    If Files.0 > 0 Then
  110.       Do
  111.       "Erase" Directory"\MEMSIZE.INF"
  112.       End
  113.    "HLP2INF" Directory"\MEMSIZE.HLP"
  114.    End
  115.  
  116. Result = SysFileTree( "SNAPSHOT.EXE", 'Files', 'F' )
  117. If Files.0 > 0 Then
  118.    Do
  119.    Copy "SNAPSHOT.EXE" Directory"\SNAPSHOT.EXE"  '1>NUL'
  120.    End
  121.  
  122. Say "Creando el objeto del programa..."
  123. Type = 'WPProgram'
  124. Title = 'Recursos del Sistema'
  125. Parms = 'OPEN=DEFAULT;MINWIN=DESKTOP;PROGTYPE=PM;EXENAME='Directory'\MEMSIZE.EXE;STARTUPDIR='Directory';OBJECTID=<MEMSIZE>;NOPRINT=YES;'
  126. Result = SysCreateObject( Type, Title, Folder, Parms, 'ReplaceIfExists' )
  127.  
  128. If Result = 1 Then
  129.   Say "El objeto se ha creado.  Fin."
  130. Else
  131.   Say "ERROR: ¡No se ha podido crear el objeto!"
  132.  
  133. Signal DONE
  134.  
  135. FAILURE:
  136. Say 'Error del REXX.'
  137. Signal DONE
  138.  
  139. HALT:
  140. Say 'Se ha parado el REXX.'
  141. Signal DONE
  142.  
  143. SYNTAX:
  144. Say 'Error de síntaxis del REXX.'
  145. Signal DONE
  146.  
  147. DONE:
  148. Exit
  149.